﻿<Window x:Class="Tanmia.Windows.SearchScenario.StatementSearch"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:la="clr-namespace:Tanmia.Basis.WPF.Controls;assembly=Tanmia.Basis"
        xmlns:cd="clr-namespace:Tanmia.Controls;assembly=Tanmia.Controls"
        Title="كشف حساب" Height="500" Width="700" MinHeight="500" MinWidth="500" FlowDirection="RightToLeft"
        WindowState="Maximized">
    <Grid Margin="8">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="6" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="6" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="6" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="6" />
            <RowDefinition Height="*" />
            <RowDefinition Height="6" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>

        <cd:ValidationTool Name="vatError" Visibility="Collapsed" ValidType="Error" Height="50" VerticalAlignment="Top" Grid.ColumnSpan="6" />

        <Label Content="{la:Labeler Path=Entity.StatementType}" Grid.Row="2" />
        <ComboBox Name="cmbStatementType" Margin="4,2,8,1" Grid.Column="1" Grid.Row="2">
            <ComboBoxItem Content="لـ زبون" IsSelected="True"/>
            <ComboBoxItem Content="لـ مورد"/>
        </ComboBox>

        <Label Content="{la:Labeler Path=Entity.Person}" Grid.Column="2" Grid.Row="2" />
        <ComboBox Name="cmbPerson" Margin="4,2,8,1" Grid.Column="3" Grid.Row="2" />

        <Label Content="رقم الحساب: " Grid.Column="4" Grid.Row="2" />
        <TextBox Name="txtAccountNumber" Margin="4,2,8,1" Grid.Column="5" IsReadOnly="True" Grid.Row="2" />

        <Label Content="{la:Labeler Path=Entity.StatementDateType}" Grid.Row="4"/>
        <ComboBox Name="cmbDateType" Margin="4,2,8,1" Grid.Column="1" Grid.Row="4">
            <ComboBoxItem Content="تاريخ آخر مطابقة" IsSelected="True"/>
            <ComboBoxItem Content="منذ البداية"/>
            <ComboBoxItem Content="مخصص" Name="aa"/>
        </ComboBox>

        <Label Content="{la:Labeler Path=Entity.From}" Grid.Column="2" Grid.Row="4"/>
        <DatePicker Name="dtpFrom" Margin="4,2,8,1" Grid.Column="3" Grid.Row="4" IsEnabled="{Binding ElementName=aa,Path=IsSelected}"/>

        <Label Content="{la:Labeler Path=Entity.To}" Grid.Column="4" Grid.Row="4"/>
        <DatePicker Name="dtpTo" Margin="4,2,8,1" Grid.Column="5" Grid.Row="4" IsEnabled="{Binding ElementName=aa,Path=IsSelected}"/>

        <Button Name="btnStartSearch" Content="بدء البحث" Grid.Row="6" Grid.ColumnSpan="6" Margin="8,2,8,1" IsDefault="True" Click="btnStartSearch_Click" />

        <DataGrid Name="SearchResultDataGrid" Grid.Row="8" Grid.ColumnSpan="6" Margin="8,2,8,1" IsReadOnly="True" CanUserAddRows="False" CanUserDeleteRows="False"
                  CanUserReorderColumns="True" CanUserResizeColumns="True" CanUserSortColumns="True" CanUserResizeRows="False" SelectionMode="Single" 
                  SelectionUnit="FullRow" AutoGenerateColumns="False">
            <DataGrid.Columns>
                <DataGridTextColumn Header="المدين" Width="100" Binding="{Binding Path=Debit}"/>
                <DataGridTextColumn Header="الدائن" Width="100" Binding="{Binding Path=Credit}"/>
                <DataGridTextColumn Header="البيان" Width="250" Binding="{Binding Path=Notes}"/>
                <DataGridTextColumn Header="الحساب" Width="100" Binding="{Binding Path=Account.Name}"/>
                <DataGridTextColumn Header="رقم الحساب" Width="75" Binding="{Binding Path=Account.Number}"/>
            </DataGrid.Columns>
        </DataGrid>
        
        <Grid Grid.Column="2" Grid.Row="10" Grid.ColumnSpan="4">
            
        </Grid>
    </Grid>
</Window>
